/**
 * Copyright (c) 2005-2012 https://github.com/zhangkaitao
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 */
package com.monkey.core.exception;

/**
 * 基础异常
 */
public class MonkeyException extends RuntimeException {

    //所属模块
    private String module;

    /**
     * 错误消息
     */
    private String message;


    public MonkeyException(String module, String message) {
        this.module = module;
        this.message = message;
    }

    public MonkeyException(String message) {
        this(null, message);
    }

    @Override
    public String getMessage() {
        return message;
    }


    public String getModule() {
        return module;
    }

    @Override
    public String toString() {
        return "MonkeyException{" +
                "module='" + module + '\'' +
                ", message='" + message + '\'' +
                '}';
    }
}
